package com.lzq.mq.nameserver.replication;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract  class ReplicationTask {


    private String taskName;

    public ReplicationTask(String taskName) {
        this.taskName = taskName;
    }

    public void startTaskAsync() {
        Thread task = new Thread(() -> {
            log.info("start job:{}", taskName);
            startTask();
        });
        task.setName(taskName);
        task.start();
    }

    abstract void startTask();
}
